<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">

<html lang="en">

<head>
  <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
  <title>LCOV - code analysis - src/caffe/util/hdf5.cpp</title>
  <link rel="stylesheet" type="text/css" href="../../../gcov.css">
</head>

<body>

  <table width="100%" border=0 cellspacing=0 cellpadding=0>
    <tr><td class="title">LCOV - code coverage report</td></tr>
    <tr><td class="ruler"><img src="../../../glass.png" width=3 height=3 alt=""></td></tr>

    <tr>
      <td width="100%">
        <table cellpadding=1 border=0 width="100%">
          <tr>
            <td width="10%" class="headerItem">Current view:</td>
            <td width="35%" class="headerValue"><a href="../../../index.html">top level</a> - <a href="index.html">src/caffe/util</a> - hdf5.cpp<span style="font-size: 80%;"> (source / <a href="hdf5.cpp.func-sort-c.html">functions</a>)</span></td>
            <td width="5%"></td>
            <td width="15%"></td>
            <td width="10%" class="headerCovTableHead">Hit</td>
            <td width="10%" class="headerCovTableHead">Total</td>
            <td width="15%" class="headerCovTableHead">Coverage</td>
          </tr>
          <tr>
            <td class="headerItem">Test:</td>
            <td class="headerValue">code analysis</td>
            <td></td>
            <td class="headerItem">Lines:</td>
            <td class="headerCovTableEntry">1</td>
            <td class="headerCovTableEntry">110</td>
            <td class="headerCovTableEntryLo">0.9 %</td>
          </tr>
          <tr>
            <td class="headerItem">Date:</td>
            <td class="headerValue">2020-09-11 22:50:33</td>
            <td></td>
            <td class="headerItem">Functions:</td>
            <td class="headerCovTableEntry">1</td>
            <td class="headerCovTableEntry">13</td>
            <td class="headerCovTableEntryLo">7.7 %</td>
          </tr>
          <tr>
            <td class="headerItem">Legend:</td>
            <td class="headerValueLeg">            Lines:
            <span class="coverLegendCov">hit</span>
            <span class="coverLegendNoCov">not hit</span>
</td>
            <td></td>
          </tr>
          <tr><td><img src="../../../glass.png" width=3 height=3 alt=""></td></tr>
        </table>
      </td>
    </tr>

    <tr><td class="ruler"><img src="../../../glass.png" width=3 height=3 alt=""></td></tr>
  </table>

  <table cellpadding=0 cellspacing=0 border=0>
    <tr>
      <td><br></td>
    </tr>
    <tr>
      <td>
<pre class="sourceHeading">          Line data    Source code</pre>
<pre class="source">
<a name="1"><span class="lineNum">       1 </span>            : #ifdef USE_HDF5</a>
<span class="lineNum">       2 </span>            : #include &quot;caffe/util/hdf5.hpp&quot;
<span class="lineNum">       3 </span>            : 
<span class="lineNum">       4 </span>            : #include &lt;string&gt;
<span class="lineNum">       5 </span>            : #include &lt;vector&gt;
<span class="lineNum">       6 </span>            : 
<span class="lineNum">       7 </span>            : namespace caffe {
<span class="lineNum">       8 </span>            : 
<a name="9"><span class="lineNum">       9 </span>            : // Verifies format of data stored in HDF5 file and reshapes blob accordingly.</a>
<span class="lineNum">      10 </span>            : template &lt;typename Dtype&gt;
<span class="lineNum">      11 </span><span class="lineNoCov">          0 : void hdf5_load_nd_dataset_helper(</span>
<span class="lineNum">      12 </span>            :     hid_t file_id, const char* dataset_name_, int min_dim, int max_dim,
<span class="lineNum">      13 </span>            :     Blob&lt;Dtype&gt;* blob, bool reshape) {
<span class="lineNum">      14 </span>            :   // Verify that the dataset exists.
<span class="lineNum">      15 </span><span class="lineNoCov">          0 :   CHECK(H5LTfind_dataset(file_id, dataset_name_))</span>
<span class="lineNum">      16 </span><span class="lineNoCov">          0 :       &lt;&lt; &quot;Failed to find HDF5 dataset &quot; &lt;&lt; dataset_name_;</span>
<span class="lineNum">      17 </span>            :   // Verify that the number of dimensions is in the accepted range.
<span class="lineNum">      18 </span>            :   herr_t status;
<span class="lineNum">      19 </span>            :   int ndims;
<span class="lineNum">      20 </span><span class="lineNoCov">          0 :   status = H5LTget_dataset_ndims(file_id, dataset_name_, &amp;ndims);</span>
<span class="lineNum">      21 </span><span class="lineNoCov">          0 :   CHECK_GE(status, 0) &lt;&lt; &quot;Failed to get dataset ndims for &quot; &lt;&lt; dataset_name_;</span>
<span class="lineNum">      22 </span><span class="lineNoCov">          0 :   CHECK_GE(ndims, min_dim);</span>
<span class="lineNum">      23 </span><span class="lineNoCov">          0 :   CHECK_LE(ndims, max_dim);</span>
<span class="lineNum">      24 </span>            : 
<span class="lineNum">      25 </span>            :   // Verify that the data format is what we expect: float or double.
<span class="lineNum">      26 </span><span class="lineNoCov">          0 :   std::vector&lt;hsize_t&gt; dims(ndims);</span>
<span class="lineNum">      27 </span>            :   H5T_class_t class_;
<span class="lineNum">      28 </span><span class="lineNoCov">          0 :   status = H5LTget_dataset_info(</span>
<span class="lineNum">      29 </span>            :       file_id, dataset_name_, dims.data(), &amp;class_, NULL);
<span class="lineNum">      30 </span><span class="lineNoCov">          0 :   CHECK_GE(status, 0) &lt;&lt; &quot;Failed to get dataset info for &quot; &lt;&lt; dataset_name_;</span>
<span class="lineNum">      31 </span><span class="lineNoCov">          0 :   switch (class_) {</span>
<span class="lineNum">      32 </span>            :   case H5T_FLOAT:
<span class="lineNum">      33 </span><span class="lineNoCov">          0 :     { LOG_FIRST_N(INFO, 1) &lt;&lt; &quot;Datatype class: H5T_FLOAT&quot;; }</span>
<span class="lineNum">      34 </span>            :     break;
<span class="lineNum">      35 </span>            :   case H5T_INTEGER:
<span class="lineNum">      36 </span><span class="lineNoCov">          0 :     { LOG_FIRST_N(INFO, 1) &lt;&lt; &quot;Datatype class: H5T_INTEGER&quot;; }</span>
<span class="lineNum">      37 </span>            :     break;
<span class="lineNum">      38 </span>            :   case H5T_TIME:
<span class="lineNum">      39 </span><span class="lineNoCov">          0 :     LOG(FATAL) &lt;&lt; &quot;Unsupported datatype class: H5T_TIME&quot;;</span>
<span class="lineNum">      40 </span>            :   case H5T_STRING:
<span class="lineNum">      41 </span><span class="lineNoCov">          0 :     LOG(FATAL) &lt;&lt; &quot;Unsupported datatype class: H5T_STRING&quot;;</span>
<span class="lineNum">      42 </span>            :   case H5T_BITFIELD:
<span class="lineNum">      43 </span><span class="lineNoCov">          0 :     LOG(FATAL) &lt;&lt; &quot;Unsupported datatype class: H5T_BITFIELD&quot;;</span>
<span class="lineNum">      44 </span>            :   case H5T_OPAQUE:
<span class="lineNum">      45 </span><span class="lineNoCov">          0 :     LOG(FATAL) &lt;&lt; &quot;Unsupported datatype class: H5T_OPAQUE&quot;;</span>
<span class="lineNum">      46 </span>            :   case H5T_COMPOUND:
<span class="lineNum">      47 </span><span class="lineNoCov">          0 :     LOG(FATAL) &lt;&lt; &quot;Unsupported datatype class: H5T_COMPOUND&quot;;</span>
<span class="lineNum">      48 </span>            :   case H5T_REFERENCE:
<span class="lineNum">      49 </span><span class="lineNoCov">          0 :     LOG(FATAL) &lt;&lt; &quot;Unsupported datatype class: H5T_REFERENCE&quot;;</span>
<span class="lineNum">      50 </span>            :   case H5T_ENUM:
<span class="lineNum">      51 </span><span class="lineNoCov">          0 :     LOG(FATAL) &lt;&lt; &quot;Unsupported datatype class: H5T_ENUM&quot;;</span>
<span class="lineNum">      52 </span>            :   case H5T_VLEN:
<span class="lineNum">      53 </span><span class="lineNoCov">          0 :     LOG(FATAL) &lt;&lt; &quot;Unsupported datatype class: H5T_VLEN&quot;;</span>
<span class="lineNum">      54 </span>            :   case H5T_ARRAY:
<span class="lineNum">      55 </span><span class="lineNoCov">          0 :     LOG(FATAL) &lt;&lt; &quot;Unsupported datatype class: H5T_ARRAY&quot;;</span>
<span class="lineNum">      56 </span>            :   default:
<span class="lineNum">      57 </span><span class="lineNoCov">          0 :     LOG(FATAL) &lt;&lt; &quot;Datatype class unknown&quot;;</span>
<span class="lineNum">      58 </span>            :   }
<span class="lineNum">      59 </span>            : 
<span class="lineNum">      60 </span>            : 
<span class="lineNum">      61 </span><span class="lineNoCov">          0 :   vector&lt;int&gt; blob_dims(dims.size());</span>
<span class="lineNum">      62 </span><span class="lineNoCov">          0 :   for (int i = 0; i &lt; dims.size(); ++i) {</span>
<span class="lineNum">      63 </span><span class="lineNoCov">          0 :     blob_dims[i] = dims[i];</span>
<span class="lineNum">      64 </span>            :   }
<span class="lineNum">      65 </span>            : 
<span class="lineNum">      66 </span><span class="lineNoCov">          0 :   if (reshape) {</span>
<span class="lineNum">      67 </span><span class="lineNoCov">          0 :     blob-&gt;Reshape(blob_dims);</span>
<span class="lineNum">      68 </span>            :   } else {
<span class="lineNum">      69 </span><span class="lineNoCov">          0 :     if (blob_dims != blob-&gt;shape()) {</span>
<span class="lineNum">      70 </span>            :       // create shape string for error message
<span class="lineNum">      71 </span><span class="lineNoCov">          0 :       ostringstream stream;</span>
<span class="lineNum">      72 </span>            :       int count = 1;
<span class="lineNum">      73 </span><span class="lineNoCov">          0 :       for (int i = 0; i &lt; blob_dims.size(); ++i) {</span>
<span class="lineNum">      74 </span><span class="lineNoCov">          0 :         stream &lt;&lt; blob_dims[i] &lt;&lt; &quot; &quot;;</span>
<span class="lineNum">      75 </span><span class="lineNoCov">          0 :         count = count * blob_dims[i];</span>
<span class="lineNum">      76 </span>            :       }
<span class="lineNum">      77 </span><span class="lineNoCov">          0 :       stream &lt;&lt; &quot;(&quot; &lt;&lt; count &lt;&lt; &quot;)&quot;;</span>
<span class="lineNum">      78 </span>            :       string source_shape_string = stream.str();
<span class="lineNum">      79 </span>            : 
<span class="lineNum">      80 </span><span class="lineNoCov">          0 :       CHECK(blob_dims == blob-&gt;shape()) &lt;&lt; &quot;Cannot load blob from hdf5; shape &quot;</span>
<span class="lineNum">      81 </span>            :             &lt;&lt; &quot;mismatch. Source shape is &quot; &lt;&lt; source_shape_string
<span class="lineNum">      82 </span><span class="lineNoCov">          0 :             &lt;&lt; &quot; target shape is &quot; &lt;&lt; blob-&gt;shape_string();</span>
<span class="lineNum">      83 </span>            :     }
<span class="lineNum">      84 </span>            :   }
<span class="lineNum">      85 </span><span class="lineNoCov">          0 : }</span>
<a name="86"><span class="lineNum">      86 </span>            : </a>
<span class="lineNum">      87 </span>            : template &lt;&gt;
<span class="lineNum">      88 </span><span class="lineNoCov">          0 : void hdf5_load_nd_dataset&lt;float&gt;(hid_t file_id, const char* dataset_name_,</span>
<span class="lineNum">      89 </span>            :         int min_dim, int max_dim, Blob&lt;float&gt;* blob, bool reshape) {
<span class="lineNum">      90 </span><span class="lineNoCov">          0 :   hdf5_load_nd_dataset_helper(file_id, dataset_name_, min_dim, max_dim, blob,</span>
<span class="lineNum">      91 </span><span class="lineNoCov">          0 :                               reshape);</span>
<span class="lineNum">      92 </span><span class="lineNoCov">          0 :   herr_t status = H5LTread_dataset_float(</span>
<span class="lineNum">      93 </span><span class="lineNoCov">          0 :     file_id, dataset_name_, blob-&gt;mutable_cpu_data());</span>
<span class="lineNum">      94 </span><span class="lineNoCov">          0 :   CHECK_GE(status, 0) &lt;&lt; &quot;Failed to read float dataset &quot; &lt;&lt; dataset_name_;</span>
<span class="lineNum">      95 </span><span class="lineNoCov">          0 : }</span>
<a name="96"><span class="lineNum">      96 </span>            : </a>
<span class="lineNum">      97 </span>            : template &lt;&gt;
<span class="lineNum">      98 </span><span class="lineNoCov">          0 : void hdf5_load_nd_dataset&lt;double&gt;(hid_t file_id, const char* dataset_name_,</span>
<span class="lineNum">      99 </span>            :         int min_dim, int max_dim, Blob&lt;double&gt;* blob, bool reshape) {
<span class="lineNum">     100 </span><span class="lineNoCov">          0 :   hdf5_load_nd_dataset_helper(file_id, dataset_name_, min_dim, max_dim, blob,</span>
<span class="lineNum">     101 </span><span class="lineNoCov">          0 :                               reshape);</span>
<span class="lineNum">     102 </span><span class="lineNoCov">          0 :   herr_t status = H5LTread_dataset_double(</span>
<span class="lineNum">     103 </span><span class="lineNoCov">          0 :     file_id, dataset_name_, blob-&gt;mutable_cpu_data());</span>
<span class="lineNum">     104 </span><span class="lineNoCov">          0 :   CHECK_GE(status, 0) &lt;&lt; &quot;Failed to read double dataset &quot; &lt;&lt; dataset_name_;</span>
<span class="lineNum">     105 </span><span class="lineNoCov">          0 : }</span>
<a name="106"><span class="lineNum">     106 </span>            : </a>
<span class="lineNum">     107 </span>            : template &lt;&gt;
<span class="lineNum">     108 </span><span class="lineNoCov">          0 : void hdf5_save_nd_dataset&lt;float&gt;(</span>
<span class="lineNum">     109 </span>            :     const hid_t file_id, const string&amp; dataset_name, const Blob&lt;float&gt;&amp; blob,
<span class="lineNum">     110 </span>            :     bool write_diff) {
<span class="lineNum">     111 </span>            :   int num_axes = blob.num_axes();
<span class="lineNum">     112 </span><span class="lineNoCov">          0 :   hsize_t *dims = new hsize_t[num_axes];</span>
<span class="lineNum">     113 </span><span class="lineNoCov">          0 :   for (int i = 0; i &lt; num_axes; ++i) {</span>
<span class="lineNum">     114 </span><span class="lineNoCov">          0 :     dims[i] = blob.shape(i);</span>
<span class="lineNum">     115 </span>            :   }
<span class="lineNum">     116 </span>            :   const float* data;
<span class="lineNum">     117 </span><span class="lineNoCov">          0 :   if (write_diff) {</span>
<span class="lineNum">     118 </span><span class="lineNoCov">          0 :     data = blob.cpu_diff();</span>
<span class="lineNum">     119 </span>            :   } else {
<span class="lineNum">     120 </span><span class="lineNoCov">          0 :     data = blob.cpu_data();</span>
<span class="lineNum">     121 </span>            :   }
<span class="lineNum">     122 </span>            :   herr_t status = H5LTmake_dataset_float(
<span class="lineNum">     123 </span><span class="lineNoCov">          0 :       file_id, dataset_name.c_str(), num_axes, dims, data);</span>
<span class="lineNum">     124 </span><span class="lineNoCov">          0 :   CHECK_GE(status, 0) &lt;&lt; &quot;Failed to make float dataset &quot; &lt;&lt; dataset_name;</span>
<span class="lineNum">     125 </span><span class="lineNoCov">          0 :   delete[] dims;</span>
<span class="lineNum">     126 </span><span class="lineNoCov">          0 : }</span>
<a name="127"><span class="lineNum">     127 </span>            : </a>
<span class="lineNum">     128 </span>            : template &lt;&gt;
<span class="lineNum">     129 </span><span class="lineNoCov">          0 : void hdf5_save_nd_dataset&lt;double&gt;(</span>
<span class="lineNum">     130 </span>            :     hid_t file_id, const string&amp; dataset_name, const Blob&lt;double&gt;&amp; blob,
<span class="lineNum">     131 </span>            :     bool write_diff) {
<span class="lineNum">     132 </span>            :   int num_axes = blob.num_axes();
<span class="lineNum">     133 </span><span class="lineNoCov">          0 :   hsize_t *dims = new hsize_t[num_axes];</span>
<span class="lineNum">     134 </span><span class="lineNoCov">          0 :   for (int i = 0; i &lt; num_axes; ++i) {</span>
<span class="lineNum">     135 </span><span class="lineNoCov">          0 :     dims[i] = blob.shape(i);</span>
<span class="lineNum">     136 </span>            :   }
<span class="lineNum">     137 </span>            :   const double* data;
<span class="lineNum">     138 </span><span class="lineNoCov">          0 :   if (write_diff) {</span>
<span class="lineNum">     139 </span><span class="lineNoCov">          0 :     data = blob.cpu_diff();</span>
<span class="lineNum">     140 </span>            :   } else {
<span class="lineNum">     141 </span><span class="lineNoCov">          0 :     data = blob.cpu_data();</span>
<span class="lineNum">     142 </span>            :   }
<span class="lineNum">     143 </span>            :   herr_t status = H5LTmake_dataset_double(
<span class="lineNum">     144 </span><span class="lineNoCov">          0 :       file_id, dataset_name.c_str(), num_axes, dims, data);</span>
<span class="lineNum">     145 </span><span class="lineNoCov">          0 :   CHECK_GE(status, 0) &lt;&lt; &quot;Failed to make double dataset &quot; &lt;&lt; dataset_name;</span>
<span class="lineNum">     146 </span><span class="lineNoCov">          0 :   delete[] dims;</span>
<a name="147"><span class="lineNum">     147 </span><span class="lineNoCov">          0 : }</span></a>
<span class="lineNum">     148 </span>            : 
<span class="lineNum">     149 </span><span class="lineNoCov">          0 : string hdf5_load_string(hid_t loc_id, const string&amp; dataset_name) {</span>
<span class="lineNum">     150 </span>            :   // Get size of dataset
<span class="lineNum">     151 </span>            :   size_t size;
<span class="lineNum">     152 </span>            :   H5T_class_t class_;
<span class="lineNum">     153 </span>            :   herr_t status = \
<span class="lineNum">     154 </span><span class="lineNoCov">          0 :     H5LTget_dataset_info(loc_id, dataset_name.c_str(), NULL, &amp;class_, &amp;size);</span>
<span class="lineNum">     155 </span><span class="lineNoCov">          0 :   CHECK_GE(status, 0) &lt;&lt; &quot;Failed to get dataset info for &quot; &lt;&lt; dataset_name;</span>
<span class="lineNum">     156 </span><span class="lineNoCov">          0 :   char *buf = new char[size];</span>
<span class="lineNum">     157 </span><span class="lineNoCov">          0 :   status = H5LTread_dataset_string(loc_id, dataset_name.c_str(), buf);</span>
<span class="lineNum">     158 </span><span class="lineNoCov">          0 :   CHECK_GE(status, 0)</span>
<span class="lineNum">     159 </span>            :     &lt;&lt; &quot;Failed to load int dataset with name &quot; &lt;&lt; dataset_name;
<span class="lineNum">     160 </span><span class="lineNoCov">          0 :   string val(buf);</span>
<span class="lineNum">     161 </span><span class="lineNoCov">          0 :   delete[] buf;</span>
<span class="lineNum">     162 </span><span class="lineNoCov">          0 :   return val;</span>
<a name="163"><span class="lineNum">     163 </span>            : }</a>
<span class="lineNum">     164 </span>            : 
<span class="lineNum">     165 </span><span class="lineNoCov">          0 : void hdf5_save_string(hid_t loc_id, const string&amp; dataset_name,</span>
<span class="lineNum">     166 </span>            :                       const string&amp; s) {
<span class="lineNum">     167 </span>            :   herr_t status = \
<span class="lineNum">     168 </span><span class="lineNoCov">          0 :     H5LTmake_dataset_string(loc_id, dataset_name.c_str(), s.c_str());</span>
<span class="lineNum">     169 </span><span class="lineNoCov">          0 :   CHECK_GE(status, 0)</span>
<span class="lineNum">     170 </span>            :     &lt;&lt; &quot;Failed to save string dataset with name &quot; &lt;&lt; dataset_name;
<a name="171"><span class="lineNum">     171 </span><span class="lineNoCov">          0 : }</span></a>
<span class="lineNum">     172 </span>            : 
<span class="lineNum">     173 </span><span class="lineNoCov">          0 : int hdf5_load_int(hid_t loc_id, const string&amp; dataset_name) {</span>
<span class="lineNum">     174 </span>            :   int val;
<span class="lineNum">     175 </span><span class="lineNoCov">          0 :   herr_t status = H5LTread_dataset_int(loc_id, dataset_name.c_str(), &amp;val);</span>
<span class="lineNum">     176 </span><span class="lineNoCov">          0 :   CHECK_GE(status, 0)</span>
<span class="lineNum">     177 </span>            :     &lt;&lt; &quot;Failed to load int dataset with name &quot; &lt;&lt; dataset_name;
<span class="lineNum">     178 </span><span class="lineNoCov">          0 :   return val;</span>
<a name="179"><span class="lineNum">     179 </span>            : }</a>
<span class="lineNum">     180 </span>            : 
<span class="lineNum">     181 </span><span class="lineNoCov">          0 : void hdf5_save_int(hid_t loc_id, const string&amp; dataset_name, int i) {</span>
<span class="lineNum">     182 </span><span class="lineNoCov">          0 :   hsize_t one = 1;</span>
<span class="lineNum">     183 </span>            :   herr_t status = \
<span class="lineNum">     184 </span><span class="lineNoCov">          0 :     H5LTmake_dataset_int(loc_id, dataset_name.c_str(), 1, &amp;one, &amp;i);</span>
<span class="lineNum">     185 </span><span class="lineNoCov">          0 :   CHECK_GE(status, 0)</span>
<span class="lineNum">     186 </span>            :     &lt;&lt; &quot;Failed to save int dataset with name &quot; &lt;&lt; dataset_name;
<a name="187"><span class="lineNum">     187 </span><span class="lineNoCov">          0 : }</span></a>
<span class="lineNum">     188 </span>            : 
<span class="lineNum">     189 </span><span class="lineNoCov">          0 : int hdf5_get_num_links(hid_t loc_id) {</span>
<span class="lineNum">     190 </span>            :   H5G_info_t info;
<span class="lineNum">     191 </span><span class="lineNoCov">          0 :   herr_t status = H5Gget_info(loc_id, &amp;info);</span>
<span class="lineNum">     192 </span><span class="lineNoCov">          0 :   CHECK_GE(status, 0) &lt;&lt; &quot;Error while counting HDF5 links.&quot;;</span>
<span class="lineNum">     193 </span><span class="lineNoCov">          0 :   return info.nlinks;</span>
<a name="194"><span class="lineNum">     194 </span>            : }</a>
<span class="lineNum">     195 </span>            : 
<span class="lineNum">     196 </span><span class="lineNoCov">          0 : string hdf5_get_name_by_idx(hid_t loc_id, int idx) {</span>
<span class="lineNum">     197 </span><span class="lineNoCov">          0 :   ssize_t str_size = H5Lget_name_by_idx(</span>
<span class="lineNum">     198 </span><span class="lineNoCov">          0 :       loc_id, &quot;.&quot;, H5_INDEX_NAME, H5_ITER_NATIVE, idx, NULL, 0, H5P_DEFAULT);</span>
<span class="lineNum">     199 </span><span class="lineNoCov">          0 :   CHECK_GE(str_size, 0) &lt;&lt; &quot;Error retrieving HDF5 dataset at index &quot; &lt;&lt; idx;</span>
<span class="lineNum">     200 </span><span class="lineNoCov">          0 :   char *c_str = new char[str_size+1];</span>
<span class="lineNum">     201 </span>            :   ssize_t status = H5Lget_name_by_idx(
<span class="lineNum">     202 </span>            :       loc_id, &quot;.&quot;, H5_INDEX_NAME, H5_ITER_NATIVE, idx, c_str, str_size+1,
<span class="lineNum">     203 </span><span class="lineNoCov">          0 :       H5P_DEFAULT);</span>
<span class="lineNum">     204 </span><span class="lineNoCov">          0 :   CHECK_GE(status, 0) &lt;&lt; &quot;Error retrieving HDF5 dataset at index &quot; &lt;&lt; idx;</span>
<span class="lineNum">     205 </span><span class="lineNoCov">          0 :   string result(c_str);</span>
<span class="lineNum">     206 </span><span class="lineNoCov">          0 :   delete[] c_str;</span>
<span class="lineNum">     207 </span><span class="lineNoCov">          0 :   return result;</span>
<a name="208"><span class="lineNum">     208 </span>            : }</a>
<span class="lineNum">     209 </span>            : 
<span class="lineNum">     210 </span><span class="lineCov">          2 : }  // namespace caffe</span>
<span class="lineNum">     211 </span>            : #endif  // USE_HDF5
</pre>
      </td>
    </tr>
  </table>
  <br>

  <table width="100%" border=0 cellspacing=0 cellpadding=0>
    <tr><td class="ruler"><img src="../../../glass.png" width=3 height=3 alt=""></td></tr>
    <tr><td class="versionInfo">Generated by: <a href="http://ltp.sourceforge.net/coverage/lcov.php" target="_parent">LCOV version 1.12</a></td></tr>
  </table>
  <br>

</body>
</html>
